package com.sj.xmlanno;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAnno {

    /**
     * 1 创建对象的操作使用配置文件方式实现
     * 2 注入属性的操作使用注解方式实现
     */
    @Test
    public void testService() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean2.xml");
        BookService bookService = (BookService) context.getBean("bookService");
        bookService.add();
    }
}
